﻿#region Copyright (C) Sector7 Software Studio. All rights reserved
/*******************************************************************************************
 * Creation
 *      Author:         Wolf Lai
 *      Date:           2013/6/10 星期一 21:37:54
 *      Version:        
 * Modification 
 *      Author: 
 *      Date: 
 *      Description: 
 *      Version:
 *******************************************************************************************/
#endregion
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.SqlClient;
using Sector7.Medical.EntityType;
using Sector7.Framework.DB;

namespace Sector7.Medical.DAO.Standard
{
    /// <summary>
    /// <!-- The description about this class. -->
    /// </summary>
    public class DrugRegTypeDAO : DAOBase<M7_DrugRegType>, IDrugRegTypeDAO
    {
        #region Public functions

        public override List<M7_DrugRegType> ReadAll()
        {
            string sql = @"
                SELECT *
                FROM M7_DrugRegType";

            using (DBHelper helper = new DBHelper())
            {
                List<M7_DrugRegType> regTypeList = new List<M7_DrugRegType>();

                SqlDataReader reader = helper.ExecuteQuery(sql);
                while (reader.Read())
                {
                    var regType = new M7_DrugRegType();
                    DBUtil.ReadData(reader, regType);
                    regTypeList.Add(regType);
                }

                return regTypeList;
            }
        }

        #endregion
    }
}
